{
	name:"Rect",
	tool:"./paint_tool/rect.shape",
	_extends : {
		key:"AbstractTool",
		path:"./paint_tool/abstract-tool.action"
	},
	onInit(){
		this.stepSize=2
		this.moveSize=1
		this.ctrlIndex = -1
	},
	getLineMeta(stepData,pos){
		let step = stepData.step
		let fp = step[0]
		let steps = Math.rect(fp,step[1]).map(p=>{
			p.r = fp.r
			return p
		})
		return Math.getLineMeta([...steps,fp],pos)
	},
	getRotateMeta(stepData){
		let {id,state,step,action} = stepData.assign()
		let rect = Math.rect(step[0],step[1])
		let steps = [...rect,step[0]].map(p=>this.newPoint(p))
		return {
			state,
			id,
			step:steps,
			action:Action.Foldline
		}
	}
}